<script>

export default {
  data(){
    return{
      list : [
        0,1,2,3,4,5,6,7,8,9
      ],

      name: '小猪猪，欢迎回家！已为您打开室内空调以及地暖，请问是否启动居家"代码开发模式" ，立即进入工作状态！'

    }
  },
  methods : {
    greet(event) {
      // `this` inside methods points to the current active instance 方法中的 `this` 指向当前活跃的组件实例
      alert(`Hello ${this.name}!`)
      // `event` is the native DOM event `event` 是 DOM 原生事件
      if (event) {

        alert(event.target.tagName)

      }
    }
  },
  mounted(){
    setTimeout(() => {
      this.list.reverse()
    }, 500);
  },
  computed : {
    newlist(){
      return this.list.filter(item => item %2 === 0)
    }
  }
}
</script>
<template>
    <div>
      <ul>
         <li v-for = "ai in newlist"  :key = "ai">{{ ai }}</li>
      </ul>
    </div>

	<button @click="greet">Greet</button>

</template>

<style scoped>
.read-the-docs {
  color: #888;
}
</style>
